package com.example.firstboot.service;

import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.example.firstboot.mapper.TbUserMapper;
import com.example.firstboot.entity.TbUser;

import java.util.List;

@Service
public class TbUserService{

    @Resource
    private TbUserMapper tbUserMapper;


    public int deleteByPrimaryKey(Integer id) {
        return tbUserMapper.deleteByPrimaryKey(id);
    }


    public int insert(TbUser record) {
        return tbUserMapper.insert(record);
    }


    public int insertSelective(TbUser record) {
        return tbUserMapper.insertSelective(record);
    }


    public TbUser selectByPrimaryKey(Integer id) {
        return tbUserMapper.selectByPrimaryKey(id);
    }

    public List<TbUser> selectByrole(Integer roleflag,String department){
        return tbUserMapper.selectByrole(roleflag,department);
    }

    public int updateByPrimaryKeySelective(TbUser record) {
        return tbUserMapper.updateByPrimaryKeySelective(record);
    }


    public int updateByPrimaryKey(TbUser record) {
        return tbUserMapper.updateByPrimaryKey(record);
    }

    public TbUser selectByUserAccount(String account) {
        return tbUserMapper.selectByUserAccount(account);
    }

    public Integer createAccount(String account, String username, String password, Integer roleFlag) {
        return tbUserMapper.createAccount(account, username, password, roleFlag);
    }

    public List<TbUser> queryAllDoc() {return tbUserMapper.queryAllDoc();}


    public List<TbUser> fuzzyQuery(String account, String username, String department) {return tbUserMapper.fuzzyQuery(account,username,department);}

    public Integer resetPasswordByAccount(String account, String md5) {
        return tbUserMapper.resetPasswordByAccount(account, md5);
    }

    public List<TbUser> selectSundayDoc(String department) {return  tbUserMapper.selectSundayDoc(department);}

    public Integer selectCountUserAmount(String roleflag) {
        return tbUserMapper.selectCountUserAmount(roleflag);
    }
}

